home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / AppleScript / Development Tools / Tools Goodies / AEGizmos 1.4.1 / Headers / AEBuild.h next >
Encoding:
C/C++ Source or Header  |  1995-03-17  |  2.6 KB  |  77 lines  |  [TEXT/MMCC]

  1. /*
  2.  *    AEBuild.h                                        Copyright ©1991,1992 Apple Computer, Inc.
  3.  */
  4.  
  5. #pragma once                                        /* For THINK C users */
  6.  
  7. #ifndef __AEBUILD__
  8. #define __AEBUILD__                                    /* For poor MPW users :) */
  9.  
  10. #ifndef __APPLEEVENTS__
  11. #include <AppleEvents.h>
  12. #endif
  13.  
  14.  
  15. #define aeBuild_SyntaxErr    12345            /* Let's get an Official OSErr code someday */
  16.  
  17. typedef enum{                                /* Syntax Error Codes: */
  18.     aeBuildSyntaxNoErr = 0,                        /* (No error) */
  19.     aeBuildSyntaxBadToken,                        /* Illegal character */
  20.     aeBuildSyntaxBadEOF,                        /* Unexpected end of format string */
  21.     aeBuildSyntaxNoEOF,                            /* Unexpected extra stuff past end */
  22.     aeBuildSyntaxBadNegative,                    /* "-" not followed by digits */
  23.     aeBuildSyntaxMissingQuote,                    /* Missing close "'" */
  24.     aeBuildSyntaxBadHex,                        /* Non-digit in hex string */
  25.     aeBuildSyntaxOddHex,                        /* Odd # of hex digits */
  26.     aeBuildSyntaxNoCloseHex,                    /* Missing "»" */
  27.     aeBuildSyntaxUncoercedHex,                    /* Hex string must be coerced to a type */
  28.     aeBuildSyntaxNoCloseString,                    /* Missing "”" */
  29.     aeBuildSyntaxBadDesc,                        /* Illegal descriptor */
  30.     aeBuildSyntaxBadData,                        /* Bad data value inside (…) */
  31.     aeBuildSyntaxNoCloseParen,                    /* Missing ")" after data value */
  32.     aeBuildSyntaxNoCloseBracket,                /* Expected "," or "]" */
  33.     aeBuildSyntaxNoCloseBrace,                    /* Expected "," or "}" */
  34.     aeBuildSyntaxNoKey,                            /* Missing keyword in record */
  35.     aeBuildSyntaxNoColon,                        /* Missing ":" after keyword in record */
  36.     aeBuildSyntaxCoercedList,                    /* Cannot coerce a list */
  37.     aeBuildSyntaxUncoercedDoubleAt                /* "@@" substitution must be coerced */
  38. } AEBuild_SyntaxErrType;
  39.  
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44.  
  45. // In all the "v..." functions, the "args" parameter is really a va_list.
  46. // It's listed as void* here to avoid having to #include stdarg.h.
  47.  
  48. // Building a descriptor:
  49.  
  50. OSErr
  51.     AEBuild(  AEDesc *dst, const char *src, ... ),
  52.     vAEBuild( AEDesc *dst, const char *src, const void *args );
  53.  
  54. // Adding a parameter to an Apple event:
  55.  
  56. OSErr
  57.     AEBuildParameters( AppleEvent *event, const char *format, ... ),
  58.     vAEBuildParameters( AppleEvent *event, const char *format, const void *args );
  59.  
  60. // Building an entire Apple event:
  61.  
  62. OSErr
  63.     AEBuildAppleEvent(    AEEventClass theClass, AEEventID theID,
  64.                         DescType addressType, const void *addressData, long addressLength,
  65.                         short returnID, long transactionID, AppleEvent *result,
  66.                         const char *paramsFmt, ... ),
  67.     vAEBuildAppleEvent(    AEEventClass theClass, AEEventID theID,
  68.                         DescType addressType, const void *addressData, long addressLength,
  69.                         short returnID, long transactionID, AppleEvent *resultEvt,
  70.                         const char *paramsFmt, const void *args );
  71.  
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75.  
  76. #endif
  77.